// number
var n1 = 10;
n1 = 20;
console.log(n1);
function add(n1, n2) {
    var total = n1 + n2;
    return total;
}
console.log(add(10, 20));
// string
var Name = "hugo";
var PrintName = "My name is " + Name;
var NewName = Name.toUpperCase();
console.log(PrintName, NewName);
// boolean
var isTrue;
isTrue = true;
console.log(isTrue);
// array
var list1 = [1, 2, 3, 4];
var list2 = [1, 2, 3, 4];
var list3 = [1, 2, 3, 4];
var list4 = [1, 'tsc'];
var list5 = [1, 'python', true];
console.log(list1, list2, list3, list4, list5);
// tuple 是固定长度，固定类型,受限的数组类型; 适用于固定限制的存储方式 比如： person: [number(学号), string(姓名)] = [2207, 'hugo']
var person1 = [1, 'hugo'];
// person1[0] = 'hugo', person1[1] = 1
// person[2] = 2
person1.push(3); // 坑
console.log(person1);
var person2 = [1, 'hugo']; // 是数组而不是元组
// union
function ToStr(n1, n2) {
    if (typeof n1 === "number" || typeof n2 === "string")
        return n1.toString() + n2.toString();
    return n1 + n2;
}
console.log(ToStr(2, 5));
var union2; // 只能设置值 0， 1， 2
// union2 = 3 // Type '3' is not assignable to type '0 | 1 | 2'
union2 = 2;
console.log(union2);
